package com.brok1n.app.android.selfstudyartifact.view.base;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.brok1n.app.android.selfstudyartifact.net.IUpdate;
import com.brok1n.app.android.selfstudyartifact.net.NetManager;

/**
 * Created by brok1n on 2016/10/15.
 */

public abstract class BaseActivity extends Activity implements IUpdate {

    public NetManager mNetManager = NetManager.getInstance();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        logd("onCreate");
    }

    @Override
    protected void onStart() {
        super.onStart();
        logd("onCreate");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        logd("onCreate");
    }

    @Override
    protected void onResume() {
        super.onResume();
        mNetManager.registerObserver( this );
        logd("onCreate");
    }

    @Override
    protected void onPause() {
        super.onPause();
        logd("onCreate");
    }

    @Override
    protected void onStop() {
        super.onStop();
        logd("onCreate");
        mNetManager.unregisterObserver( this );
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        logd("onCreate");
    }

    public void loge(String str)
    {
        Log.e("" + getClass().getName(), "" + str );
    }

    public void logd( String str )
    {
        Log.d("" + getClass().getName(), "" + str );
    }
}
